package com.iotp.service.equipment_data;

import com.iotp.dao.equipment_data.EquipmentDataMapper;
import com.iotp.entity.equipment_data.EquipmentData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("equipmentDataService")
public class EquipmentDataServiceImpl implements EquipmentDataService {

    @Autowired
    private EquipmentDataMapper equipmentDataMapper;
    @Override
    public Long add(EquipmentData equipmentData) {
        this.equipmentDataMapper.insert(equipmentData);
        return equipmentData.getId();
    }

    @Override
    public void update(EquipmentData equipmentData) {
        this.equipmentDataMapper.updateByPrimaryKey(equipmentData);
    }

    @Override
    public void delete(Long id) {
        this.equipmentDataMapper.deleteByPrimaryKey(id);
    }

    @Override
    public EquipmentData queryById(Long id) {
        return this.equipmentDataMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<EquipmentData> queryByList(EquipmentData equipmentData) {
        return this.equipmentDataMapper.selectByCondition(equipmentData);
    }
}
